<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCitiesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cities', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name')->nullable(false)->default('')->comment('城市名');
            $table->string('state')->nullable(false)->default('')->comment('省份');
            $table->string('country')->nullable(false)->default('')->comment('国家');
            $table->string('slug')->nullable(false)->default('');
            $table->decimal('latitude',11,8)->nullable()->comment('纬度');
            $table->decimal('longitude',11,8)->nullable()->comment('经度');
            $table->decimal('radius',4,2)->nullable()->comment('半径');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cities');
    }
}
